@inject('route', 'Illuminate\Support\Facades\Route')
@inject('user', 'App\Models\User')
<?php
$arr = explode('/',Request::path());
$module = isset($arr[1])?$arr[1]:'ILOVEYOU';
$uri = Route::getCurrentRoute()->getUri();

/*$acl = config('acl');

foreach ($acl as $key=>$item) {
    echo "<BR><BR>key:".$key;
    echo "<BR>item:".$item;
}
$user_id = Auth::user()->id;
$users = $user->hasPermission('user');
echo "<BR>leen users:".$users."sotp";*/
?>
<ul class="sidebar-menu">
    <li class="header">功能菜单</li>
    <li class="treeview">
        <a href="/admin">
            <i class="fa fa-dashboard"></i> <span>控制面板</span> <i class="fa fa-bars pull-right"></i>
        </a>

    </li>

    @can('user')
    <li class="treeview" >
        <a href="#"><i class="fa fa-user-secret"></i> <span>用户管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">
            <li><a href="/admin/admin_role"><i class="fa fa-users"></i>角色列表</a></li>
            <li><a href="/admin/user"><i class="fa fa-reorder"></i>用户列表</a></li>
        </ul>
    </li>
    @endcan
    @can('goods')
    <li class="treeview" >
        <a href="#"><i class="fa fa-th-large"></i> <span>商品管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">
            <li><a href="/admin/goods"><i class="fa fa-reorder"></i>商品列表</a></li>
            <li><a href="/admin/category"><i class="fa fa-sitemap"></i>商品分类</a></li>
            <li><a href="/admin/activity"><i class="fa fa-gift"></i>活动专题</a></li>
            <li><a href="/admin/recommend_position"><i class="fa fa-bullhorn"></i>推荐位置</a></li>
            @can('shop')
                <li><a href="/admin/shop"><i class="fa fa-reorder"></i>商铺列表</a></li>
            @endcan
            @can('brand')
                <li><a href="/admin/brand"><i class="fa fa-reorder"></i>品牌列表</a></li>
            @endcan
            @can('product')
                <li><a href="/admin/product"><i class="fa fa-reorder"></i>产品列表</a></li>
            @endcan
        </ul>
    </li>
    @endcan
    @can('goods')
    <li class="treeview" >
        <a href="#"><i class="fa fa-shopping-cart"></i> <span>订单管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">

            @can('order_query')
                <li><a href="/admin/order"><i class="fa  fa-navicon"></i>订单查询</a></li>
            @endcan

            @can('order_shipping')
                <li><a href="/admin/order/shippingOrder"><i class="fa  fa-navicon"></i>订单发货</a></li>
            @endcan

            @can('customer')
                <li><a href="/admin/refund"><i class="fa fa-reorder"></i>退货商品列表</a></li>
            @endcan

            @can('push_tarrif')
                <li><a href="/admin/push_tarrif"><i class="fa fa-reorder"></i>推关订单列表</a></li>
            @endcan
        </ul>
    </li>
    @endcan
    @can('ad')
    @can('ad_list')
    <li class="treeview" >
        <a href="#"><i class="fa fa-newspaper-o"></i> <span>广告管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">
            @can('ad_list')
                <li><a href="/admin/ad_position"><i class="fa fa-reorder"></i>广告列表</a></li>
            @endcan
        </ul>
    </li>
    @endcan
    @endcan

    @can('operationLog')
    <li class="treeview" >
        <a href="#"><i class="fa fa-list-alt"></i> <span>操作日志</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">
            <li><a href="/admin/operationLog"><i class="fa fa-reorder"></i>日志列表</a></li>
       </ul>
    </li>
    @endcan

    @can('storage')
    <li class="treeview" >
        <a href="#"><i class="glyphicon glyphicon-stats"></i> <span>仓储管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">

            @can('stock')
            <li><a href="/admin/stock_history"><i class="fa fa-reorder"></i>库存操作日志</a></li>
            @endcan

            @can('goodsEorder')
            <li><a href="/admin/goodsEorder"><i class="fa fa-reorder"></i>商品备案列表</a></li>
            @endcan

            @can('accountBooks')
            <li><a href="/admin/account_books"><i class="fa fa-reorder"></i>账册对账</a></li>
            @endcan
        </ul>
    </li>
    @endcan

    @can('keywords')
    <li class="treeview" >
        <a href="#"><i class="fa fa-buysellads"></i> <span>关键词配置</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">
            <li><a href="/admin/keywords"><i class="fa fa-reorder"></i>关键词列表</a></li>

        </ul>
    </li>
    @endcan

    @can('coupon')
    <li class="treeview" >
        <a href="#"><i class="glyphicon glyphicon-stats"></i> <span>优惠券管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">

            @can('coupon_list')
            <li><a href="/admin/coupon"><i class="fa fa-reorder"></i>优惠券列表</a></li>
            @endcan
            @can('mass_message')
            <li><a href="/admin/coupon_message"><i class="fa fa-reorder"></i>群发短信</a></li>
            @endcan

        </ul>
    </li>
    @endcan

    @can('discount')
    <li class="treeview" >
        <a href="#"><i class="glyphicon glyphicon-stats"></i> <span>限时折扣管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">

            @can('discount_list')
            <li><a href="/admin/discount"><i class="fa fa-reorder"></i>限时折扣列表</a></li>
            @endcan

        </ul>
    </li>
    @endcan

    @can('message')
    <li class="treeview" >
        <a href="#"><i class="glyphicon glyphicon-stats"></i> <span>短信管理</span> <i class="fa fa-angle-left pull-right"></i></a>
        <ul class="treeview-menu">

            @can('message_list')
            <li><a href="/admin/message"><i class="fa fa-reorder"></i>短信任务列表</a></li>
            @endcan

        </ul>
    </li>
    @endcan

</ul>